package acm;

import java.util.Comparator;
import java.util.Scanner;

//大数运算
public class BigNumberOperate {

	public static String add(int[] a, int[] b) {
		int[] result = new int[Math.max(a.length, b.length) + 1];
		int k = 0, g = 0;
		for (int i = 0, j = 0; i < a.length || j < b.length;) {
			System.out.print("a[i]" + a[i] + " b[j]" + b[j]);
			int c = a[i++] + b[j++] + g;
			result[k++] = c % 10;
			g = c / 10; // 进位
			// 当两者都计算完成，就进位
			if (j == b.length && i == a.length) {
				result[k] = g;
			}
			System.out.println("c" + c + "g" + g);
		}
		if (result[result.length - 1] != 0) {
			System.out.print(result[result.length - 1]);
		}
		for (int l = result.length - 2; l >= 0; l--) {
			System.out.print(result[l]);
		}
		return null;
	}

	public static class A implements Comparator<BigNumberOperate> {
		@Override
		public int compare(BigNumberOperate o1, BigNumberOperate o2) {
			return 0;
		}

		@Override
		public boolean equals(Object obj) {
			return super.equals(obj);
		}
	}

	@SuppressWarnings("unused")
	public static void main(String[] args) {
		A a1, b1;
		a1 = new A();
		b1 = a1;
		Scanner scanner = new Scanner(System.in);
		String firstNum = scanner.next();
		String secondNum = scanner.next();
		int length = Math.max(firstNum.length(), secondNum.length());
		// 将数组的长度定义为最长的
		int[] a = new int[length];
		int[] b = new int[length];
		// 将输入的数字用字符串存储的值转换为整形数组
		// 注意字符串中最开始的应该是数组中的最高位
		for (int k = 0; k < firstNum.length(); k++) {
			a[k] = Integer.parseInt(String.valueOf(firstNum.charAt(firstNum
					.length() - k - 1)));
		}
		for (int k = 0; k < secondNum.length(); k++) {
			b[k] = Integer.parseInt(String.valueOf(secondNum.charAt(secondNum
					.length() - k - 1)));
		}
		add(a, b);
		scanner.close();
	}
}
